import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'home',
    redirect: '/home'
  },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
    {
    path: '/home',
    component: () => import(/* webpackChunkName: "about" */ '../views/HomeView.vue'),
    redirect: '/theme',
    children:[
      {path: '/theme',component: () => import(/* webpackChunkName: "about" */ '../views/theme/themes.vue')},
      {path: '/users',component: () => import(/* webpackChunkName: "about" */ '../views/user/users.vue')},
      {path: '/article/detail',component: () => import(/* webpackChunkName: "about" */ '../views/article/articleDetail.vue')},
      {path: '/user/info',component: () => import(/* webpackChunkName: "about" */ '../views/user/userDetail.vue')},
      {path: '/particular/theme/',component: () => import(/* webpackChunkName: "about" */ '../views/theme/theme.vue')},
      {path: '/user/login',component: () => import(/* webpackChunkName: "about" */ '../views/user/userLogin.vue')}
    ]
  },
  {
    path: '/user/login',
    component: () => import(/* webpackChunkName: "about" */ '../views/user/userLogin.vue')
  },
  {
    path: '/theme',
    component: () => import(/* webpackChunkName: "about" */ '../views/theme/theme.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
